import apiClient from './index'

export default {
  getWebsites() {
    return apiClient.get('/websites')
  },
  getWebsitesByCategory(categoryId: number) {
    return apiClient.get(`/websites/category/${categoryId}`)
  },
  createWebsite(website: { name: string; url: string; categoryId: number }) {
    return apiClient.post('/websites', website)
  },
  deleteWebsite(id: number) {
    return apiClient.delete(`/websites/${id}`)
  },
  fetchWebsiteInfo(url: string) {
    return apiClient.get(`/websites/fetch?url=${encodeURIComponent(url)}`)
  }
}